|
|
|
|
|
|
|
way, if running your program causes the system to crash (yes, it canand doeshappen to the best of us), you won't lose your work. |
|
|
|
|
|
|
|
|
Saving Visual Basic Projects |
|
|
|
|
|
|
|
|
The process of saving a project is a little more complex than you might expect; however, with a little practice you'll have no problem. To save a project, you must save each component of your project (each form, code module, and so on) into its own file, and then save the project itself into its project file. Think of the project file as a list of the names and locations of the components that make up the project. |
|
|
|
|
| |
|
|
|
|
It's a good idea to create a folder on your hard drive for each project that you work on. This makes it easy to keep all the files that make up a particular project organized in one place. If you follow this practice, you can also store nonVisual Basic files, such as documentation, project cost analysis spreadsheets, customized graphics, and so on, in the same folder. |
|
|
|
|
|
|
|
|
|
|
To save a project, choose File, Save Project from the Visual Basic menu system, or simply click the Save Project button on the toolbar. The first time you save the project, (or after you subsequently add any files to the project) you'll be led through one or more of the Save File As dialog boxes (see Figure 2.6), one for each of the project components, and then a Save Project As dialog box for the project file. You specify the name and location of each file where the components (and project) are to be saved. Subsequent Save Project operations simply resave the components using the same filenames as before. Then you can easily execute frequent, quick saves of a previously saved project by clicking the Save Project button. If one or more components have been added to the project since it was last saved, the Save File As dialog box will be presented for each new component. |
|
|
|
|
|
|
|
|
|
Visual Basic has an option that assists you in making sure your project is properly saved. Choose Tools, Options from Visual Basic's main menu, and then click the Options dialog's Environment tab. In the When a Program Starts frame, you can tell Visual Basic to automatically save any changes to your project when you run it, or to prompt you to decide if changes should be saved before running.  |
|
|
|
|
|
|
|
|
|
|
Figure 2.6
The Save File As dialog box enables you
to specify the name and location of the files
that store your application's components. |
|
|
|
|
|